package com.timerecording.controller;

import com.timerecording.common.SwaggerTagConst;
import com.timerecording.common.controller.UsersAdminBaseController;
import com.timerecording.service.users.UserService;
import com.timerecording.util.ResponseDTO;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**  获取用户信息
 * @author smz41
 * @description: TODO
 * @date 2025/7/25
 */
@CrossOrigin  //解决跨域
@RestController
@Api(tags = {SwaggerTagConst.Admin.USERS})
public class UserController extends UsersAdminBaseController {


    @Autowired
    private UserService userService;


    /** 获取用户信息
     * @description: TODO
     * @author smz
     * @version 1.0
     * @date 2025/7/25
     */

    @PostMapping("currentUser")
    public ResponseDTO currentUser(@RequestHeader("Authorization") String token){
        //根据token查询用户信息
        return userService.currentUserByToken(token);

    }


}
